<template>
  <template v-if="user">
    <van-cell title="当前用户" :value="user?.username"/>
    <van-cell title="修改信息" is-link to="/userUpdate"/>
    <van-cell title="我创建的队伍" is-link to="/userCreateTeam"/>
    <van-cell title="我加入的队伍" is-link to="/userJoinTeam"/>
  </template>
</template>

<script lang="ts" setup>
import {useRouter} from "vue-router";
import {onMounted, ref} from "vue";
import {getCurrentUser} from "../../services/user";

const router = useRouter();
const user = ref({})

onMounted(async () => {
  user.value = await getCurrentUser();
})


const toEdit = (editKey: string, editName: string, currentValue: string) => {
  router.push({
    path: "/editUser",
    query: {
      editKey,
      editName,
      currentValue
    }
  })
}
</script>

<style lang="less" scoped>
</style>